home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / intro_blas3.z / intro_blas3
Encoding:
Text File  |  2002-10-03  |  19.0 KB  |  463 lines

  1.  
  2.  
  3.  
  4. IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))                                                IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333 - Introduction to matrix-matrix linear algebra subprograms
  10.  
  11. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  12.      See individual man pages for operating system and hardware availability.
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      The Level 3 Basic Linear Algebra Subprograms (Level 3 BLAS) consist of
  16.      routines that perform matrix-matrix operations.  These routines are
  17.      written to run optimally on all SGI systems.
  18.  
  19.      The following data types are used in these routines:
  20.  
  21.      *   Single precision: Fortran "real" data type, C/C++ "float" data type,
  22.          32-bit floating point; these routine names begin with SSSS.
  23.  
  24.      *   Single precision complex: Fortran "complex" data type, C/C++
  25.          "scsl_complex" data type (defined in <<<<ssssccccssssllll____bbbbllllaaaassss....hhhh>>>>), C++ STL
  26.          "complex<float>" data type (defined in <<<<ccccoooommmmpppplllleeeexxxx....hhhh>), two 32-bit
  27.          floating point reals; these routine names begin with CCCC.
  28.  
  29.      *   Double precision: Fortran "double precision" data type, C/C++
  30.          "double" data type, 64-bit floating point; these routine names begin
  31.          with DDDD.
  32.  
  33.      *   Double precision complex: Fortran "double complex" data type, C/C++
  34.          "scsl_zomplex" data type (defined in <<<<ssssccccssssllll____bbbbllllaaaassss....hhhh>>>>), C++ STL
  35.          "complex<double>" data type (defined in <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>), two 64-bit
  36.          floating point doubles; these routine names begin with ZZZZ.
  37.  
  38.      Often little or no difference exists between these versions, other than
  39.      the data types of some inputs and outputs.  In this case, the routines
  40.      are described on the same man page, and that man page is named after the
  41.      single precision or single precision complex routine.
  42.  
  43.      NOTE: SCSL supports two different C interfaces to the BLAS:
  44.  
  45.      *   The C interface described in this man page and in individual BLAS man
  46.          pages follows the same conventions used for the C interface to the
  47.          SCSL signal processing library.
  48.  
  49.      *   SCSL also supports the C interface to the legacy BLAS set forth by
  50.          the BLAS Technical Forum.  This interface supports row-major storage
  51.          of multidimensional arrays; see IIIINNNNTTTTRRRROOOO____CCCCBBBBLLLLAAAASSSS(3S) for details.
  52.  
  53.      By default, the integer arguments are 4 bytes (32 bits) in size; this is
  54.      the size obtained when one links to the SCSL library with ----llllssssccccssss or
  55.      ----llllssssccccssss____mmmmpppp. Another version of SCSL is available, however, in which
  56.      integers are 8 bytes (64 bits).  This version allows the user access to
  57.      larger memory sizes and helps when porting legacy Cray codes.  It can be
  58.      loaded by using either the ----llllssssccccssss____iiii8888 or ----llllssssccccssss____iiii8888____mmmmpppp link option.  Note
  59.      that any program may use only one of the two versions; 4-byte integer and
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))                                                IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      8-byte integer library calls cannot be mixed.
  75.  
  76.      C/C++ function prototypes for Level 3 BLAS routines are provided in
  77.      <<<<ssssccccssssllll____bbbbllllaaaassss....hhhh>>>>, when using the default 4-byte integers, and
  78.      <<<<ssssccccssssllll____bbbbllllaaaassss____iiii8888....hhhh>>>>, when using 8-byte integers. These header files define
  79.      the complex types ssssccccssssllll____ccccoooommmmpppplllleeeexxxx and ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx, which are used in the
  80.      prototypes. Alternatively, C++ programs may declare arguments using the
  81.      types ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> and ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> from the standard template
  82.      library. But if these types are used, <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>> must be included before
  83.      <<<<ssssccccssssllll____bbbbllllaaaassss....hhhh>>>> (or <<<<ssssccccssssllll____bbbbllllaaaassss____iiii8888....hhhh>>>>). Note, though, that both complex
  84.      types are equivalent: they simply represent (real, imaginary) pairs of
  85.      floating point numbers stored contiguously in memory. With the proper
  86.      casts, you can simply pass arrays of floating point data to the routines
  87.      where complex arguments are expected.
  88.  
  89.      Casts, however, can be avoided. The header files <<<<ssssccccssssllll____bbbbllllaaaassss....hhhh>>>> and
  90.      <<<<ssssccccssssllll____bbbbllllaaaassss____iiii8888....hhhh>>>> directly support the use of user-defined complex types
  91.      or disabling prototype checking for complex arguments completely.  By
  92.      defining the symbol SSSSCCCCSSSSLLLL____VVVVOOOOIIIIDDDD____AAAARRRRGGGGSSSS before including <<<<ssssccccssssllll____bbbbllllaaaassss....hhhh>>>> or
  93.      <<<<ssssccccssssllll____bbbbllllaaaassss____iiii8888....hhhh>>>> all complex arguments will be prototyped as vvvvooooiiiidddd ****.  To
  94.      define the symbol SSSSCCCCSSSSLLLL____VVVVOOOOIIIIDDDD____AAAARRRRGGGGSSSS at compile time use the ----DDDD compiler
  95.      option (i.e., ----DDDDSSSSCCCCSSSSLLLL____VVVVOOOOIIIIDDDD____AAAARRRRGGGGSSSS) or use an explicit ####ddddeeeeffffiiiinnnneeee SSSSCCCCSSSSLLLL____VVVVOOOOIIIIDDDD____AAAARRRRGGGGSSSS
  96.      in the source code.  This allows the use of any complex data structure
  97.      without warnings from the compiler, provided the structure is as
  98.      described above; that is:
  99.  
  100.      1.   The real and imaginary components must be contiguous in memory.
  101.  
  102.      2.   Sequential array elements must also be contiguous in memory.
  103.  
  104.      While this allows the use of non-standard complex types without
  105.      generating compiler warnings, it has the disadvantage that the compiler
  106.      will not catch type mismatches.
  107.  
  108.      Strong type checking can be enabled employing user-defined complex types
  109.      instead of SCSL's standard complex types. To do this, define
  110.      SSSSCCCCSSSSLLLL____UUUUSSSSEEEERRRR____CCCCOOOOMMMMPPPPLLLLEEEEXXXX____TTTT====_m_y__c_o_m_p_l_e_x and SSSSCCCCSSSSLLLL____UUUUSSSSEEEERRRR____ZZZZOOOOMMMMPPPPLLLLEEEEXXXX____TTTT====_m_y__z_o_m_p_l_e_x, where
  111.      _m_y__c_o_m_p_l_e_x and _m_y__z_o_m_p_l_e_x are the names of user-defined complex types.
  112.      These complex types must be defined before including the <<<<ssssccccssssllll____bbbbllllaaaassss....hhhh>>>>
  113.      (or <<<<ssssccccssssllll____bbbbllllaaaassss____iiii8888....hhhh>>>>) header file.
  114.  
  115.      Fortran 90 users on IRIX systems can perform compile-time checking of
  116.      SCSL BLAS subroutine and function calls by adding UUUUSSSSEEEE SSSSCCCCSSSSLLLL____BBBBLLLLAAAASSSS (for 4-
  117.      byte integer arguments) or UUUUSSSSEEEE SSSSCCCCSSSSLLLL____BBBBLLLLAAAASSSS____IIII8888 (for 8-byte integer
  118.      arguments) to the source code from which the BLAS calls are made.
  119.      Alternatively, the compile-time checking can be invoked without any
  120.      source code modifications by using the ----aaaauuuuttttoooo____uuuusssseeee compiler option, e.g.,
  121.  
  122.           f90 -auto_use SCSL_BLAS test.f -lscs
  123.           f90 -auto_use SCSL_BLAS_I8 -i8 test.f -lscs_i8
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))                                                IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))
  137.  
  138.  
  139.  
  140.    AAAArrrrrrrraaaayyyy SSSSttttoooorrrraaaaggggeeee
  141.      Multidimensional arrays passed as arguments to BLAS routines must be
  142.      stored in column-major order, the storage convention used in Fortran
  143.      programs. C and C++ users must explicitly store multidimensional arrays
  144.      column-by-column. One way to do this is to reverse the order of array
  145.      dimensions with respect to the Fortran declaration (e.g., xxxx((((llllddddxxxx,,,,nnnn)))) in
  146.      Fortran versus xxxx[[[[nnnn]]]][[[[llllddddxxxx]]]] in C/C++). Because of the prototypes used in
  147.      <<<<ssssccccssssllll____bbbbllllaaaassss....hhhh>>>>, the array should be cast as a pointer to the appropriate
  148.      type when passed as an argument to a BLAS routine in order to avoid
  149.      potential compiler type mismatch errors or warning messages.
  150.  
  151.      C and C++ users who want to employ row-major storage for multidimensional
  152.      arrays when calling the BLAS routines should consult the IIIINNNNTTTTRRRROOOO____CCCCBBBBLLLLAAAASSSS(3S)
  153.      man page.
  154.  
  155.    MMMMaaaannnn ppppaaaaggggeeee nnnnaaaammmmiiiinnnngggg
  156.      The mmmmaaaannnn(1) command can find a man page online by either the real,
  157.      complex, double precision, or double complex name.
  158.  
  159.      The following table describes the naming conventions for these routines:
  160.  
  161.      -------------------------------------------------------------
  162.                                             Single        Double
  163.                  Single        Double       Precision     Precision
  164.                  Precision     Precision    Complex       Complex
  165.      -------------------------------------------------------------
  166.      form:       Sname         Dname        Cname         Zname
  167.      example:    SGEMM         DGEMM        CGEMM         ZGEMM
  168.      -------------------------------------------------------------
  169.  
  170.  
  171.    LLLLiiiisssstttt ooooffff LLLLeeeevvvveeeellll 3333 BBBBaaaassssiiiicccc LLLLiiiinnnneeeeaaaarrrr
  172.      The following list describes these routines.  The list is in alphabetic
  173.      order, except that a _H_e_r_m_i_t_i_a_n matrix routine (any routine whose name
  174.      begins with CCCCHHHH) is grouped next to equivalent _s_y_m_m_e_t_r_i_c matrix routines
  175.      (whose names begin with SSSSSSSS or CCCCSSSS).  This is because the Hermitian
  176.      property is a type of symmetry.
  177.  
  178.      Each routine marked with an asterisk (*) is an extension to the standard
  179.      set of Level 3 BLAS routines.
  180.  
  181.      *   SSSSGGGGEEEEMMMMMMMM, DDDDGGGGEEEEMMMMMMMM, CCCCGGGGEEEEMMMMMMMM, ZZZZGGGGEEEEMMMMMMMM:  Multiplies a real or complex general
  182.          matrix by a real or complex general matrix.
  183.  
  184.               C <- alpha op(A)op(B) + beta C
  185.  
  186.               where
  187.  
  188.               op(X) = X
  189.  
  190.               or
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))                                                IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))
  203.  
  204.  
  205.  
  206.                        T
  207.               op(X) = X
  208.  
  209.  
  210.               or
  211.  
  212.                        H
  213.               op(X) = X   (CGEMM/ZGEMM only)
  214.  
  215.  
  216.      *   CCCCGGGGEEEEMMMMMMMM3333MMMM****, ZZZZGGGGEEEEMMMMMMMM3333MMMM****:  Multiplies a complex general matrix by a complex
  217.          general matrix, using 3 real matrix multiplications and 5 matrix
  218.          additions.
  219.  
  220.               C <- alpha op(A)op(B) + beta C
  221.  
  222.               where
  223.  
  224.               op(X) = X
  225.  
  226.               or
  227.  
  228.                        T
  229.               op(X) = X
  230.  
  231.               or
  232.  
  233.                        H
  234.               op(X) = X
  235.  
  236.  
  237.      *   DDDDGGGGEEEEMMMMMMMMSSSS*:  Multiplies a double precision general matrix by a double
  238.          precision general matrix, using a variation of Strassen's algorithm.
  239.  
  240.               C <- alpha op(A)op(B) + beta C
  241.  
  242.               where
  243.  
  244.               op(X) = X
  245.  
  246.               or
  247.  
  248.                        T
  249.               op(X) = X
  250.  
  251.  
  252.      *   SSSSSSSSYYYYMMMMMMMM, DDDDSSSSYYYYMMMMMMMM, CCCCSSSSYYYYMMMMMMMM, ZZZZSSSSYYYYMMMMMMMM:  Multiplies a real or complex general
  253.          matrix by a real or complex symmetric matrix.
  254.  
  255.               C <- alpha AB + beta C
  256.               or
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))                                                IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))
  269.  
  270.  
  271.  
  272.               C <- alpha BA + beta C
  273.  
  274.  
  275.      *   CCCCHHHHEEEEMMMMMMMM, ZZZZHHHHEEEEMMMMMMMM:  Multiplies a complex general matrix by a Hermitian
  276.          matrix.
  277.  
  278.               C <- alpha AB + beta C
  279.  
  280.               or
  281.  
  282.               C <- alpha BA + beta C
  283.  
  284.  
  285.      *   SSSSSSSSYYYYRRRR2222KKKK, DDDDSSSSYYYYRRRR2222KKKK, CCCCSSSSYYYYRRRR2222KKKK, ZZZZSSSSYYYYRRRR2222KKKK:  Performs symmetric rank 2_k update of
  286.          a real or complex symmetric matrix.
  287.  
  288.                            _T           _T
  289.               _C <- _a_l_p_h_a _A_B  + _a_l_p_h_a _B_A  + _b_e_t_a _C
  290.  
  291.               _o_r
  292.  
  293.                                       _T
  294.               _C <- _a_l_p_h_a _A _B + _a_l_p_h_a _B _A + _b_e_t_a _C
  295.  
  296.  
  297.      *   CCCCHHHHEEEERRRR2222KKKK, ZZZZHHHHEEEERRRR2222KKKK:  Performs Hermitian rank 2_k update of a complex
  298.          Hermitian matrix.
  299.  
  300.                            H           H
  301.               C <- alpha AB  + alpha BA  + beta C
  302.  
  303.               or
  304.  
  305.                           H           H
  306.               C <- alpha A B + alpha B A + beta C
  307.  
  308.  
  309.      *   SSSSSSSSYYYYRRRRKKKK, DDDDSSSSYYYYRRRRKKKK, CCCCSSSSYYYYRRRRKKKK, ZZZZSSSSYYYYRRRRKKKK:  Performs symmetric rank _k update of a
  310.          real or complex symmetric matrix.
  311.  
  312.                            T
  313.               C <- alpha AA  + beta C
  314.  
  315.               or
  316.  
  317.                           T
  318.               C <- alpha A A + beta C
  319.  
  320.  
  321.      *   CCCCHHHHEEEERRRRKKKK, ZZZZHHHHEEEERRRRKKKK:  Performs Hermitian rank _k update of a complex
  322.          Hermitian matrix.
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))                                                IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))
  335.  
  336.  
  337.  
  338.                            H
  339.               C <- alpha AA  + beta C
  340.  
  341.               or
  342.  
  343.                           H
  344.               C <- alpha A A + beta C
  345.  
  346.  
  347.      *   SSSSTTTTRRRRMMMMMMMM, DDDDTTTTRRRRMMMMMMMM, CCCCTTTTRRRRMMMMMMMM, ZZZZTTTTRRRRMMMMMMMM:  Multiplies a real or complex general
  348.          matrix by a real or complex triangular matrix.
  349.  
  350.               B <- alpha op(A)B
  351.  
  352.               or
  353.  
  354.               B <- alpha B op(A)
  355.  
  356.               where
  357.  
  358.               op(A) = A
  359.  
  360.               or
  361.  
  362.                        T
  363.               op(A) = A
  364.  
  365.               or
  366.  
  367.                        H
  368.               op(A) = A (CTRMM/ZTRMM only)
  369.  
  370.  
  371.      *   SSSSTTTTRRRRSSSSMMMM, DDDDTTTTRRRRSSSSMMMM, CCCCTTTTRRRRSSSSMMMM, ZZZZTTTTRRRRSSSSMMMM:  Solves a real or complex triangular
  372.          system of equations with multiple right-hand sides.
  373.  
  374.                              -1
  375.               B <- alpha op(A) B
  376.  
  377.               or
  378.  
  379.                                -1
  380.               B <- alpha B op(A)
  381.  
  382.               where
  383.  
  384.               op(A) = A
  385.  
  386.               or
  387.  
  388.                        T
  389.               op(A) = A
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))                                                IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS3333((((3333SSSS))))
  401.  
  402.  
  403.  
  404.               or
  405.  
  406.                        H
  407.               op(A) = A  (CTRSM/ZTRSM only)
  408.  
  409.  
  410. NNNNOOOOTTTTEEEESSSS
  411.      SCSL does not currently support reshaped arrays.
  412.  
  413. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  414.      Dongarra, J., J. Du Croz, I. Duff, and S. Hammarling,"A Set of Level 3
  415.      Basic Linear Algebra Subprograms," _A_C_M _T_r_a_n_s_a_c_t_i_o_n_s _o_n _M_a_t_h_e_m_a_t_i_c_a_l
  416.      _S_o_f_t_w_a_r_e, Vol. 16, No. 1, March 1990, pp. 1 - 17.
  417.  
  418.      IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S), IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS1111(3S), IIIINNNNTTTTRRRROOOO____BBBBLLLLAAAASSSS2222(3S), IIIINNNNTTTTRRRROOOO____CCCCBBBBLLLLAAAASSSS(3S)
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.                                                                         PPPPaaaaggggeeee 7777
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.